package com.wuhanpe.leafid.service

import com.wuhanpe.leafid.entity.Result
import com.wuhanpe.leafid.generator.IDGen
import jakarta.annotation.PostConstruct
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * @author zooy
 * @since 2025/9/12-16:04
 */
@Service
class SegmentService {

    @Autowired
    lateinit var idGen: IDGen

    @PostConstruct
    fun init() {
        idGen.init()
    }

    fun getId(key: String): Result {
        return idGen.get(key)
    }
}
